import React, { Component } from 'react'

import { imgLegends } from './legendNames'

export default class Legend extends Component {
    render() {
        const imgs = imgLegends

        return (
            <div className="graph-legend">
                <div className="legend-title">图例</div>
                <div className="legend-subtitle">实体</div>
                {
                    imgs.map(({pathname, labelname}) => {
                        return (
                            <div key={pathname}>
                                <img className="legend-icon" src={require(`../../assets/img/${pathname}.png`)} alt="" />
                                <span className="legend-label">{labelname}</span>
                            </div>
                        )
                    })
                }
            </div>
        )
    }
}
